package com.ssy.lingxi.marketing.model.constant;

import com.ssy.lingxi.common.language.LanguageHolder;

import java.util.Arrays;

/**
 *  平台活动报名内部状态
 * @author ds
 * @date 2021/6/18
 * @version 2.0.0
 */
public enum PlatformActivitySignUpInnerStatusEnum {

    ALL(0, "所有状态"),
    TO_BE_SUBMIT_EXAMINE(1, "待提交审核"),
    TO_BE_EXAMINE_1(2, "待审核(一级)"),
    EXAMINE_NO_PASS_1(3, "审核不通过(一级)"),
    TO_BE_EXAMINE_2(4, "待审核(二级)"),
    EXAMINE_NO_PASS_2(5, "审核不通过(二级)"),
    TO_BE_SUBMIT(6, "待提交"),
    SUBMITTED(7, "已提交"),
    ;

    private final Integer code;
    private final String message;

    PlatformActivitySignUpInnerStatusEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return LanguageHolder.getName(this.getClass(), this.code);
    }

    public static String getMessage(Integer code) {
        PlatformActivitySignUpInnerStatusEnum statusEnum = Arrays.stream(PlatformActivitySignUpInnerStatusEnum.values()).filter(e -> e.getCode().equals(code)).findFirst().orElse(null);
        return statusEnum==null?"":statusEnum.getMessage();
    }


}
